<style>
    .xxpayPopupDiv .layui-form-label {
        width:15% !important;
        margin-left:1%;
    }
    .xxpayPopupDiv .layui-input-inline {
        width: 33% !important;
        margin-top: 0px;
    }
</style>
<div class="layui-fluid">
  <div class="layui-card">
    <div class="layui-tab layui-tab-brief">
      <div class="layui-tab-content">
          <form class="layui-form layui-form-pane" action="">
              <div class="layui-form-item">
                  <label class="layui-form-label">商户ID</label>
                  <div class="layui-input-inline">
                      <input type="text" id="mchId" disabled="disabled" class="layui-input">
                  </div>
                  <label class="layui-form-label">变更金额</label>
                  <div class="layui-input-inline">
                      <input type="text" id="amount" disabled="disabled" class="layui-input">
                  </div>
              </div>
              <div class="layui-form-item">
                  <label class="layui-form-label">变更前账户余额</label>
                  <div class="layui-input-inline">
                      <input type="text" id="balance" disabled="disabled" class="layui-input">
                  </div>
                  <label class="layui-form-label">资金变动方向</label>
                  <div class="layui-input-inline">
                      <input type="text" id="fundDirection" disabled="disabled" class="layui-input">
                  </div>
              </div>
              <div class="layui-form-item">
                  <label class="layui-form-label">订单金额</label>
                  <div class="layui-input-inline">
                      <input type="text" id="orderAmount" disabled="disabled" class="layui-input">
                  </div>
                  <label class="layui-form-label">平台利润</label>
                  <div class="layui-input-inline">
                      <input type="text" id="platProfit" disabled="disabled" class="layui-input">
                  </div>
              </div>
              <div class="layui-form-item">
                  <label class="layui-form-label">总代理商ID</label>
                  <div class="layui-input-inline">
                      <input type="text" id="parentAgentId" disabled="disabled" class="layui-input">
                  </div>
                  <label class="layui-form-label">总代理商利润</label>
                  <div class="layui-input-inline">
                      <input type="text" id="parentAgentProfit" disabled="disabled" class="layui-input">
                  </div>
              </div>
              <div class="layui-form-item">
                  <label class="layui-form-label">商户代理ID</label>
                  <div class="layui-input-inline">
                      <input type="text" id="agentId" disabled="disabled" class="layui-input">
                  </div>
                  <label class="layui-form-label">商户代理利润</label>
                  <div class="layui-input-inline">
                      <input type="text" id="agentProfit" disabled="disabled" class="layui-input">
                  </div>
              </div>
              <div class="layui-form-item">
                  <label class="layui-form-label">业务类型</label>
                  <div class="layui-input-inline">
                      <input type="text" id="bizType" disabled="disabled" class="layui-input">
                  </div>
                  <label class="layui-form-label">业务类目</label>
                  <div class="layui-input-inline">
                      <input type="text" id="bizItem" disabled="disabled" class="layui-input">
                  </div>
              </div>
              <div class="layui-form-item">
                  <label class="layui-form-label">渠道成本(元)</label>
                  <div class="layui-input-inline">
                      <input type="text" id="channelCost" disabled="disabled" class="layui-input">
                  </div>
                  <label class="layui-form-label">渠道订单号</label>
                  <div class="layui-input-inline">
                      <input type="text" id="channelOrderNo" disabled="disabled" class="layui-input">
                  </div>

                  <!--<label class="layui-form-label">是否允许结算</label>
                  <div class="layui-input-inline">
                      <input type="text" id="isAllowSett" disabled="disabled" class="layui-input">
                  </div>-->
              </div>
              <!--<div class="layui-form-item">
                  <label class="layui-form-label">商户结算</label>
                  <div class="layui-input-inline">
                      <input type="text" id="mchSettStatus" disabled="disabled" class="layui-input">
                  </div>
                  <label class="layui-form-label">代理商结算</label>
                  <div class="layui-input-inline">
                      <input type="text" id="agentSettStatus" disabled="disabled" class="layui-input">
                  </div>
              </div>-->
              <div class="layui-form-item">
                <label class="layui-form-label">业务订单</label>
                <div class="layui-input-inline">
                    <input type="text" id="orderId" disabled="disabled" class="layui-input">
                </div>
                  <label class="layui-form-label">备注</label>
                  <div class="layui-input-inline">
                      <input type="text" id="remark" disabled="disabled" class="layui-input">
                  </div>
              </div>
              <div class="layui-form-item">
                  <label class="layui-form-label">创建时间</label>
                  <div class="layui-input-inline">
                      <input type="text" id="createTime" disabled="disabled" class="layui-input">
                  </div>
                  <label class="layui-form-label">修改时间</label>
                  <div class="layui-input-inline">
                      <input type="text" id="updateTime" disabled="disabled" class="layui-input">
                  </div>
              </div>
          </form>
      </div>
    </div>
  </div>
</div>
<script>
    layui.use(['admin', 'form'],function(){
        var form = layui.form
        ,$ = layui.$
        ,admin = layui.admin
        ,element = layui.element
        ,view = layui.view
        ,layer = layui.layer ;
        // 导航
        element.render('breadcrumb', 'breadcrumb');
        var id = view.getOpenParams('id');
        admin.req({
            type: 'get',
            url: layui.setter.baseUrl + '/account/history_get',
            data: {
                id : id
            },
            error: function(err){
                layer.alert(JSON.stringify(err.field), {
                    title: '错误提示'
                })
            },
            success: function(res){
                if(res.code == 0){
                    $('#mchId').val(res.data.mchId);
                    $('#amount').val(res.data.amount/100);
                    $('#balance').val(res.data.balance/100);
                    $('#afterBalance').val(res.data.afterBalance/100);
                    $('#fee').val(res.data.fee/100);
                    $('#fundDirection').val(res.data.fundDirection ==1?"加款":"减款");
                    $('#agentId').val(res.data.agentId);
                    $('#parentAgentId').val(res.data.parentAgentId ==null?"":res.data.parentAgentId);
                    $('#orderAmount').val(res.data.orderAmount/100);
                    $('#agentProfit').val(res.data.agentProfit/100);
                    $('#parentAgentProfit').val(res.data.parentAgentProfit/100);
                    $('#platProfit').val(res.data.platProfit/100);
                    $('#channelCost').val(res.data.channelCost/100);
                    $('#isAllowSett').val(res.data.isAllowSett ==1?"允许":"不允许");
                    $('#mchSettStatus').val(res.data.mchSettStatus ==1?"已结算":"未结算");
                    $('#agentSettStatus').val(res.data.agentSettStatus ==1?"已结算":"未结算");
                    $('#orderId').val(res.data.orderId);
                    $('#channelOrderNo').val(res.data.channelOrderNo);
                    $('#bizType').val(res.data.bizType ==1?"支付":res.data.bizType ==2?"提现":res.data.bizType ==3?"调账":res.data.bizType ==4?"充值":res.data.bizType ==5?"差错处理":res.data.bizType ==6?"代付":"");
                    $('#bizItem').val(res.data.bizItem ==10?"账户余额":res.data.bizItem ==11?"代付余额":res.data.bizItem ==12?"冻结金额":res.data.bizItem ==13?"保证金额":res.data.bizItem ==14?"代付账户冻结金额":res.data.bizItem ==20?"支付":res.data.bizItem ==21?"代付":res.data.bizItem ==22?"线下充值":res.data.bizItem ==23?"线上充值":"");
                    $('#riskDay').val(res.data.riskDay);
                    $('#remark').val(res.data.remark);
                    if(res.data.createTime != "" && res.data.createTime != null) {
                        $('#createTime').val(layui.util.toDateString(res.data.createTime));
                    }
                    if(res.data.updateTime != "" && res.data.updateTime != null) {
                        $('#updateTime').val(layui.util.toDateString(res.data.updateTime));
                    }
                    form.render();
                }else{
                    layer.alert({title:'请求成功，但是获取数据失败'});
                }
            }
        })
    })
</script>